Optimal. Leaf size=207 \[ -\frac {(d e-c f) (a+b x)^{1-n} (e+f x)^{-3+n}}{f (b e-a f) (3-n)}+\frac {(b (2 c f+d e (1-n))-a d f (3-n)) (a+b x)^{1-n} (e+f x)^{-2+n}}{f (b e-a f)^2 (2-n) (3-n)}+\frac {b (b (2 c f+d e (1-n))-a d f (3-n)) (a+b x)^{1-n} (e+f x)^{-1+n}}{f (b e-a f)^3 (1-n) (2-n) (3-n)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 205, normalized size of antiderivative = 0.99, number of steps
used = 3, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {80, 47, 37}
\begin {gather*} -\frac {(a+b x)^{1-n} (d e-c f) (e+f x)^{n-3}}{f (3-n) (b e-a f)}+\frac {(a+b x)^{1-n} (e+f x)^{n-2} (-a d f (3-n)+2 b c f+b d e (1-n))}{f (2-n) (3-n) (b e-a f)^2}+\frac {b (a+b x)^{1-n} (e+f x)^{n-1} (-a d f (3-n)+2 b c f+b d e (1-n))}{f (1-n) (2-n) (3-n) (b e-a f)^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 37
Rule 47
Rule 80
Rubi steps
\begin {align*} \int (a+b x)^{-n} (c+d x) (e+f x)^{-4+n} \, dx &=-\frac {(d e-c f) (a+b x)^{1-n} (e+f x)^{-3+n}}{f (b e-a f) (3-n)}-\frac {(-2 b c f-d (b e (1-n)+a f (-3+n))) \int (a+b x)^{-n} (e+f x)^{-3+n} \, dx}{f (-b e+a f) (-3+n)}\\ &=-\frac {(d e-c f) (a+b x)^{1-n} (e+f x)^{-3+n}}{f (b e-a f) (3-n)}+\frac {(2 b c f+b d e (1-n)-a d f (3-n)) (a+b x)^{1-n} (e+f x)^{-2+n}}{f (b e-a f)^2 (2-n) (3-n)}-\frac {(b (-2 b c f-d (b e (1-n)+a f (-3+n)))) \int (a+b x)^{-n} (e+f x)^{-2+n} \, dx}{f (b e-a f) (-b e+a f) (2-n) (-3+n)}\\ &=-\frac {(d e-c f) (a+b x)^{1-n} (e+f x)^{-3+n}}{f (b e-a f) (3-n)}+\frac {(2 b c f+b d e (1-n)-a d f (3-n)) (a+b x)^{1-n} (e+f x)^{-2+n}}{f (b e-a f)^2 (2-n) (3-n)}+\frac {b (2 b c f+b d e (1-n)-a d f (3-n)) (a+b x)^{1-n} (e+f x)^{-1+n}}{f (b e-a f)^3 (1-n) (2-n) (3-n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.18, size = 180, normalized size = 0.87 \begin {gather*} \frac {(a+b x)^{1-n} (e+f x)^{-3+n} \left (a^2 f (-1+n) (-d e+c f (-2+n)+d f (-3+n) x)+b^2 \left (d e (-1+n) x (e (-3+n)-f x)+c \left (e^2 \left (6-5 n+n^2\right )-2 e f (-3+n) x+2 f^2 x^2\right )\right )+a b \left (2 c f (-1+n) (-e (-3+n)+f x)+d \left (e^2 (-3+n)-2 e f \left (5-4 n+n^2\right ) x+f^2 (-3+n) x^2\right )\right )\right )}{(-b e+a f)^3 (-3+n) (-2+n) (-1+n)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(504\) vs.
\(2(207)=414\).
time = 0.10, size = 505, normalized size = 2.44
method | result | size |
gosper | \(\frac {\left (b x +a \right ) \left (f x +e \right )^{-3+n} \left (a^{2} d \,f^{2} n^{2} x -2 a b d e f \,n^{2} x +a b d \,f^{2} n \,x^{2}+b^{2} d \,e^{2} n^{2} x -b^{2} d e f n \,x^{2}+a^{2} c \,f^{2} n^{2}-4 a^{2} d \,f^{2} n x -2 a b c e f \,n^{2}+2 a b c \,f^{2} n x +8 a b d e f n x -3 a b d \,f^{2} x^{2}+b^{2} c \,e^{2} n^{2}-2 b^{2} c e f n x +2 b^{2} c \,f^{2} x^{2}-4 b^{2} d \,e^{2} n x +b^{2} d e f \,x^{2}-3 a^{2} c \,f^{2} n -a^{2} d e f n +3 a^{2} d \,f^{2} x +8 a b c e f n -2 a b c \,f^{2} x +a b d \,e^{2} n -10 a b d e f x -5 b^{2} c \,e^{2} n +6 b^{2} c e f x +3 b^{2} d \,e^{2} x +2 a^{2} c \,f^{2}+a^{2} d e f -6 a b c e f -3 a b d \,e^{2}+6 b^{2} c \,e^{2}\right ) \left (b x +a \right )^{-n}}{a^{3} f^{3} n^{3}-3 a^{2} b e \,f^{2} n^{3}+3 a \,b^{2} e^{2} f \,n^{3}-b^{3} e^{3} n^{3}-6 a^{3} f^{3} n^{2}+18 a^{2} b e \,f^{2} n^{2}-18 a \,b^{2} e^{2} f \,n^{2}+6 b^{3} e^{3} n^{2}+11 a^{3} f^{3} n -33 a^{2} b e \,f^{2} n +33 a \,b^{2} e^{2} f n -11 b^{3} e^{3} n -6 a^{3} f^{3}+18 a^{2} b e \,f^{2}-18 a \,b^{2} e^{2} f +6 b^{3} e^{3}}\) | \(505\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 876 vs.
\(2 (195) = 390\).
time = 1.84, size = 876, normalized size = 4.23 \begin {gather*} \frac {{\left ({\left (a b^{2} d f^{3} n + {\left (2 \, b^{3} c - 3 \, a b^{2} d\right )} f^{3}\right )} x^{4} + {\left (a^{2} b d f^{3} n^{2} + {\left (2 \, a b^{2} c - 3 \, a^{2} b d\right )} f^{3} n\right )} x^{3} + {\left (3 \, a^{3} d f^{3} + {\left (a^{2} b c + a^{3} d\right )} f^{3} n^{2} - {\left (a^{2} b c + 4 \, a^{3} d\right )} f^{3} n\right )} x^{2} + {\left (a^{3} c f^{3} n^{2} - 3 \, a^{3} c f^{3} n + 2 \, a^{3} c f^{3}\right )} x + {\left (a b^{2} c n^{2} + 6 \, a b^{2} c - 3 \, a^{2} b d + {\left (b^{3} d n^{2} - 4 \, b^{3} d n + 3 \, b^{3} d\right )} x^{2} - {\left (5 \, a b^{2} c - a^{2} b d\right )} n + {\left (6 \, b^{3} c + {\left (b^{3} c + a b^{2} d\right )} n^{2} - {\left (5 \, b^{3} c + 3 \, a b^{2} d\right )} n\right )} x\right )} e^{3} - {\left (2 \, a^{2} b c f n^{2} - {\left (b^{3} d f n^{2} - 5 \, b^{3} d f n + 4 \, b^{3} d f\right )} x^{3} - {\left (8 \, a^{2} b c - a^{3} d\right )} f n - {\left ({\left (b^{3} c - a b^{2} d\right )} f n^{2} - {\left (7 \, b^{3} c - 4 \, a b^{2} d\right )} f n + 3 \, {\left (4 \, b^{3} c - 3 \, a b^{2} d\right )} f\right )} x^{2} + {\left (6 \, a^{2} b c - a^{3} d\right )} f + {\left ({\left (a b^{2} c + 2 \, a^{2} b d\right )} f n^{2} - {\left (a b^{2} c + 8 \, a^{2} b d\right )} f n - 6 \, {\left (a b^{2} c - 2 \, a^{2} b d\right )} f\right )} x\right )} e^{2} + {\left (a^{3} c f^{2} n^{2} - 3 \, a^{3} c f^{2} n + 2 \, a^{3} c f^{2} - {\left (b^{3} d f^{2} n - b^{3} d f^{2}\right )} x^{4} - 2 \, {\left (a b^{2} d f^{2} n^{2} + {\left (b^{3} c - 4 \, a b^{2} d\right )} f^{2} n - 2 \, {\left (2 \, b^{3} c - 3 \, a b^{2} d\right )} f^{2}\right )} x^{3} - {\left (9 \, a^{2} b d f^{2} + {\left (2 \, a b^{2} c + a^{2} b d\right )} f^{2} n^{2} - 4 \, {\left (2 \, a b^{2} c + a^{2} b d\right )} f^{2} n\right )} x^{2} - {\left ({\left (a^{2} b c - a^{3} d\right )} f^{2} n^{2} - {\left (7 \, a^{2} b c - 5 \, a^{3} d\right )} f^{2} n + 2 \, {\left (3 \, a^{2} b c - 2 \, a^{3} d\right )} f^{2}\right )} x\right )} e\right )} {\left (f x + e\right )}^{n - 4}}{{\left (a^{3} f^{3} n^{3} - 6 \, a^{3} f^{3} n^{2} + 11 \, a^{3} f^{3} n - 6 \, a^{3} f^{3} - {\left (b^{3} n^{3} - 6 \, b^{3} n^{2} + 11 \, b^{3} n - 6 \, b^{3}\right )} e^{3} + 3 \, {\left (a b^{2} f n^{3} - 6 \, a b^{2} f n^{2} + 11 \, a b^{2} f n - 6 \, a b^{2} f\right )} e^{2} - 3 \, {\left (a^{2} b f^{2} n^{3} - 6 \, a^{2} b f^{2} n^{2} + 11 \, a^{2} b f^{2} n - 6 \, a^{2} b f^{2}\right )} e\right )} {\left (b x + a\right )}^{n}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.48, size = 869, normalized size = 4.20 \begin {gather*} \frac {x\,{\left (e+f\,x\right )}^{n-4}\,\left (d\,a^3\,e\,f^2\,n^2-5\,d\,a^3\,e\,f^2\,n+4\,d\,a^3\,e\,f^2+c\,a^3\,f^3\,n^2-3\,c\,a^3\,f^3\,n+2\,c\,a^3\,f^3-2\,d\,a^2\,b\,e^2\,f\,n^2+8\,d\,a^2\,b\,e^2\,f\,n-12\,d\,a^2\,b\,e^2\,f-c\,a^2\,b\,e\,f^2\,n^2+7\,c\,a^2\,b\,e\,f^2\,n-6\,c\,a^2\,b\,e\,f^2+d\,a\,b^2\,e^3\,n^2-3\,d\,a\,b^2\,e^3\,n-c\,a\,b^2\,e^2\,f\,n^2+c\,a\,b^2\,e^2\,f\,n+6\,c\,a\,b^2\,e^2\,f+c\,b^3\,e^3\,n^2-5\,c\,b^3\,e^3\,n+6\,c\,b^3\,e^3\right )}{{\left (a\,f-b\,e\right )}^3\,{\left (a+b\,x\right )}^n\,\left (n^3-6\,n^2+11\,n-6\right )}+\frac {x^2\,{\left (e+f\,x\right )}^{n-4}\,\left (d\,a^3\,f^3\,n^2-4\,d\,a^3\,f^3\,n+3\,d\,a^3\,f^3-d\,a^2\,b\,e\,f^2\,n^2+4\,d\,a^2\,b\,e\,f^2\,n-9\,d\,a^2\,b\,e\,f^2+c\,a^2\,b\,f^3\,n^2-c\,a^2\,b\,f^3\,n-d\,a\,b^2\,e^2\,f\,n^2+4\,d\,a\,b^2\,e^2\,f\,n-9\,d\,a\,b^2\,e^2\,f-2\,c\,a\,b^2\,e\,f^2\,n^2+8\,c\,a\,b^2\,e\,f^2\,n+d\,b^3\,e^3\,n^2-4\,d\,b^3\,e^3\,n+3\,d\,b^3\,e^3+c\,b^3\,e^2\,f\,n^2-7\,c\,b^3\,e^2\,f\,n+12\,c\,b^3\,e^2\,f\right )}{{\left (a\,f-b\,e\right )}^3\,{\left (a+b\,x\right )}^n\,\left (n^3-6\,n^2+11\,n-6\right )}+\frac {a\,e\,{\left (e+f\,x\right )}^{n-4}\,\left (-d\,a^2\,e\,f\,n+d\,a^2\,e\,f+c\,a^2\,f^2\,n^2-3\,c\,a^2\,f^2\,n+2\,c\,a^2\,f^2+d\,a\,b\,e^2\,n-3\,d\,a\,b\,e^2-2\,c\,a\,b\,e\,f\,n^2+8\,c\,a\,b\,e\,f\,n-6\,c\,a\,b\,e\,f+c\,b^2\,e^2\,n^2-5\,c\,b^2\,e^2\,n+6\,c\,b^2\,e^2\right )}{{\left (a\,f-b\,e\right )}^3\,{\left (a+b\,x\right )}^n\,\left (n^3-6\,n^2+11\,n-6\right )}+\frac {b^2\,f^2\,x^4\,{\left (e+f\,x\right )}^{n-4}\,\left (2\,b\,c\,f-3\,a\,d\,f+b\,d\,e+a\,d\,f\,n-b\,d\,e\,n\right )}{{\left (a\,f-b\,e\right )}^3\,{\left (a+b\,x\right )}^n\,\left (n^3-6\,n^2+11\,n-6\right )}+\frac {b\,f\,x^3\,{\left (e+f\,x\right )}^{n-4}\,\left (4\,b\,e+a\,f\,n-b\,e\,n\right )\,\left (2\,b\,c\,f-3\,a\,d\,f+b\,d\,e+a\,d\,f\,n-b\,d\,e\,n\right )}{{\left (a\,f-b\,e\right )}^3\,{\left (a+b\,x\right )}^n\,\left (n^3-6\,n^2+11\,n-6\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________